<?php

class Common_Log_Writer_InMemory extends Zend_Log_Writer_Abstract
{

    private $obj_formatter = null;
    private $arr_log = array();

    public function __construct()
    {
        $this->obj_formatter = new Zend_Log_Formatter_Simple();
    }

    static public function factory($config)
    {
        return new self();
    }

    protected function _write($event)
    {
        $str_line = $this->obj_formatter->format($event);
        $this->arr_log[] = trim($str_line);
    }

    public function getLog()
    {
        return $this->arr_log;
    }
    
}
